﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace TGIApp.Web.Controllers
{
    public class HomeController : Controller
    {
        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to te248";
            log.DebugFormat("Index called");
            return View();
        }

        public ActionResult About()
        {
            return View();
        }
        [HttpPost]
        public JsonResult FindCities(string searchText, int maxResults)
        {
            var proxy = new Proxy.ServiceProxy();
            var cities = proxy.FindCities(searchText, maxResults);
            return Json(cities);
        }
    }
}
